<!--js date picker-->

<link href="<?php echo base_url(); ?>./css/css_datepicker/jquery.ui.all.css" rel="stylesheet" type="text/css" />  
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.widget.js"></script>
<!--end js date picker-->
<!--the start of function date picker-->

<script language="javascript" type="text/javascript">
    $(function() {
        $( ".datepicker" ).datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'yy:mm:dd' 
        });
    });
           
</script>
<style type="text/css">
    
    .task1 p{ color: red;font-size: 12px;}
    .task1 span{color:red;}
</style>
<div class="task1">
    <?php
    echo '<div>';
    echo '</div>';
    $sex = array(' ' => '-please select-', 'Female' => 'Female', 'Male' => 'Male');
    $usertype = array(' ' => '-please select-', 1 => 'admin', 0 => 'Receptionist');
    echo form_open('students/add');
    echo '<div class="form-wrapper">';
    echo '<fieldset style="margin: 0 auto;width:auto;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
    if ($this->session->userdata('ms_error')) {
        echo message($this->session->userdata('ms_error'), "error");
        $this->session->unset_userdata("ms_error");
    }
    echo '<legend align="center"><div class="heading"  style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 20px;">Add New Students</div></legend>';
    echo '<div style="float: right; border: 0px #ccc solid; margin-top: -25px;">';
    echo anchor('students/manager' , img('images/user_images/cancel.png'));
    echo '</div>';
    ?>
    <table border="0"  align="center" style="font-weight: lighter;font-size: 14px; text-align: left;" >

        <tr>
            <td valign='top'>Student Name <span>*</span></td>

            <td>: <input type="text"  id="student" name="txt_studentname" value="<?php echo ($this->input->post("txt_studentname")) ? $this->input->post("txt_studentname") : "" ?>" size="30" /><?php echo form_error('txt_studentname'); ?></td>
            <td><p style="color:#cc0000;display: none;" >Field name is require!</p></td>
        </tr>

        <tr>
            <td valign='top'>Student Date of Birth:</td>
            <td>: <input type="text" name="text_dob" class="datepicker" value="<?php echo ($this->input->post("text_dob")) ? $this->input->post("text_dob") : "" ?>" /><?php echo form_error('text_dob'); ?></td> 
            <td><p style="color:#cc0000;display: none;">Field name is require!</p></td>
        </tr>

        <tr>
            <td valign='top'>Student Phone:</td>
            <td>: <input type="text" name="txt_phone"  id="phone"  size="30" value="<?php echo ($this->input->post("txt_phone")) ? $this->input->post("txt_phone") : "" ?>"><?php echo form_error('txt_phone'); ?></td> 
            <td><p style="color:#cc0000;display: none;">Field name is require!</p></td>
        </tr>

        <tr>
            <td valign='top'>Sex<span>*</span></td>
            <td> <?php echo form_dropdown('studentsex', $sex, $this->input->post("studentsex") ? $this->input->post("studentsex") : " ") ?></td>
            <td><p style="color:#cc0000;display: none;">Field name is require!</p></td>
        </tr>

        <tr>
            <td valign='top'>Student E-mail:</td>
            <td>: <input type="text" name="txt_mail" value="<?php echo ($this->input->post("txt_mail")) ? $this->input->post("txt_mail") : "" ?>"  id ="stu_email" size="30"><?php
    echo form_error('txt_mail');
    echo $this->session->userdata('invalid_mail');
    echo $this->session->unset_userdata('invalid_mail');
    ?></td>   
            <td></td>
        </tr>

        <tr>
            <td valign="top">Student Type&nbsp;<span>*</span></td> 
            <td>:
                <select name="stud_type" value="<?php echo ($this->input->post("stud_type")) ? $this->input->post("stud_type") : "" ?>"
                        <option value="">-Select Student Type-</option>
                            <?php
                            $this->db->select('*');
                            $selectdata = $this->db->get('tbl_stu_type');
                            foreach ($selectdata->result() as $rows) {
                                echo'<option value="' . $rows->stu_type_id . '">' . $rows->stu_type_name . '</option>';
                            }
                            ?>
                </select> 
            </td>
            <td></td>
        </tr>

        <tr>
            <td valign='top'>Would you like to be a mailing list? </td>
            <?php
            echo '<td>' . form_radio(array('name' => 'mail', 'value' => 'yes')) . 'Yes' . form_radio(array('name' => 'mail', 'value' => 'no')) . 'No' . '</td>';
            ?>
            <td></td>
        </tr>

        <tr> 
            <?php
            echo'<tr>';
            echo '<td>How did you hear about Nataraj Yaga? </td>';
            echo '<td>' . form_radio(array('name' => 'stu_type', 'value' => 'friend')) . 'Friend' . form_radio(array('name' => 'stu_type', 'value' => 'Advertise')) . 'Advertisemet' . form_radio(array('name' => 'stu_type', 'value' => 'internet')) . 'Inernet' . form_radio(array('name' => 'stu_type', 'value' => 'other')) . 'Others' . '</td>';
            echo '<td></td>';
            echo '</tr>';
            ?>

            <?php
            echo '<tr>';
            echo '<td>Descripton :</td>';
            echo '<td> ' . form_textarea(array('name' => 'txt_description', 'rows' => '8', 'cols' => '50', 'value' => $this->input->post("txt_description") ? $this->input->post("txt_description") : " ")) . '</td>';
            echo '<td></td>';
            echo'</tr>';
            ?>
            
            <?php
            echo '<tr>';
            echo '<td></td>';
            echo '<td>' . form_input(array('name' => 'btn_submit', 'type' => 'submit', 'value' => 'Submit')) . form_input(array('type' => 'reset', 'value' => 'Reset')) . '</td>';
            //echo '<td>'.anchor(array('type'=>'button','students/manager'=>'Cansel')).'</td>';
            echo '</tr>';
            ?>
            </td>
        </tr>
    </table>
    <?php
    echo '<p>Note : (*) must be insert!<p>';
    echo '</fieldset>';
    echo '</div>';
    echo form_close();
    ?>
</div>